﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.Composition;
using Bzure.Apps.Security.ViewModels;
//using Bzure.Apps.Security.ViewTemplates;

namespace Bzure.Apps.Security
{
    [Export(typeof(IApplicationStart)), ExportMetadata("ProviderName", "SecurityAppStarter")]
    public class SecurityAppStarter : IApplicationStart
    {
        /// <summary>
        /// 契约实现的版本号
        /// </summary>
        public float ContractVersion { get { return 1.0F; } }
        public void PreStart(IApplicationStartContext StartContext)
        {
            StartContext.SetPageView((NotificationViewModel model) => { return new Views.Notification(); }, () => { return default(SiteMaster); });
            StartContext.SetPageView((LogonViewModel model) => { return new Views.LogOn(); }, () => { return new Views.PublicMaster(); });
            StartContext.SetPageView((RegisterViewModel model) => { return new Views.Register(); }, () => { return new Views.PublicMaster(); });
            StartContext.SetPageView((ChangePasswordViewModel model) => { return new Views.ChangePassword(); }, () => { return new Views.PublicMaster(); });
            StartContext.SetPageView((ResetNickNameViewModel model) => { return new Views.ResetNickName(); }, () => { return new Views.PublicMaster(); });
            StartContext.SetPageView((NewRoleViewModel model) => { return new Views.NewRole(); }, () => { return new Views.InternalMaster(); });
            StartContext.SetPageView((ListRoleViewModel model) => { return new Views.ListRole(); }, () => { return new Views.InternalMaster(); });
            StartContext.SetPageView((ListUserViewModel model) => { return new Views.ListUser(); }, () => { return new Views.InternalMaster(); });
            StartContext.SetPageView((ResetPasswordViewModel model) => { return new Views.ResetPassword(); }, () => { return new Views.InternalMaster(); });
            StartContext.SetPageView((AuthorizeUserViewModel model) => { return new Views.AuthorizeUser(); }, () => { return new Views.InternalMaster(); });
            StartContext.SetPageView((DroitConfigViewModel model) => { return new Views.DroitConfig(); }, () => { return new Views.InternalMaster(); });
        }
        public void Start(IApplicationStartContext StartContext)
        {
        }
    }
}
